import React from 'react';
import { Checkbox } from 'antd';
import { AxFormItemBase } from '../lib/AxFormItemBase';
import { AxCheckboxProps } from './AxCheckboxGroupProps';
import './style.css';

export const AxCheckbox: React.FC<AxCheckboxProps> = (props) => {
    const {
        ...rest
    } = props;

    const WrappedComponent = Checkbox;

    return (
        <AxFormItemBase
            style={{ width: '100%' }}
            formItemClassName='ax-checkbox'
            valuePropName={{ valuePropName: 'checked' }}
            WrappedComponent={WrappedComponent}
            {...rest}
        />
    );
}

/** 自定义 margin-bottom:0px 的Select */
export const AxCheckboxNoMarginBottom: React.FC<AxCheckboxProps> = props => {
    return <AxCheckbox formItemClassName="ant-form-item-ax" {...props} />;
};
